#ifndef ICON_H
#define ICON_H

#include <QGraphicsRectItem>
#include <QPixmap>
#include <QImage>
#include <QPainter>
#include <QGraphicsColorizeEffect>
#include <QGraphicsDropShadowEffect>
#include <QKeyEvent>
#include <QGraphicsScene>

class Icon: public QObject, public QGraphicsRectItem
{
    Q_OBJECT
public:
    bool status;
    Icon( QImage img_on , QImage img_off, QGraphicsScene *scene);
    void changeStatus();

signals:
    void clicked();

public slots:
    void updateSelection();

protected:
    void paint( QPainter *, const QStyleOptionGraphicsItem *option, QWidget *widget );
    QVariant itemChange(GraphicsItemChange change, const QVariant &value);

private:
    QImage *image_on, *image_off;
    QGraphicsDropShadowEffect *selectedEffect;
    QGraphicsScene *m_scene;
    QPainterPath m_path;
};

#endif // ICON_H
